
package sapat;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.DefaultListModel;

/**
 *
 * @author jorge
 */
public class Main {
      static Connection conn=null;
    static Statement st=null;
    static ResultSet rs=null;

    DefaultListModel modelo1=new    DefaultListModel();
    static String bd="XE";
    static String login="SYSTEM";
    static String password="jorge";
    static String url="jdbc:oracle:thin:@jorge-HP:1521:XE";
   

   public static Connection Enlace(Connection conn)throws SQLException{
     try
     {
         Class.forName("oracle.jdbc.OracleDriver");
         conn=DriverManager.getConnection(url, login, password);
     }
     catch(ClassNotFoundException e)
     {
         System.out.println("clase no encontrada");
     }
     return conn;
   }
   public static Statement sta(Statement st)throws SQLException{
       conn=Enlace(conn);

       st=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
       return st;
   }
   
    public static void main(String[] args) {
        Main d= new Main();

    }
}


